package router

import (
	"github.com/gin-gonic/gin"
	"net/http"
	"phys-perm-backend/handler"
)

func Init() *gin.Engine {
	r := gin.Default()
	r.GET("/", func(c *gin.Context) {
		c.String(http.StatusOK, "hello World!")
	})
	r.POST("login", handler.Login)
	r.POST("/userRoleAdd", handler.UserRoleAdd)
	r.POST("/roleNodeAdd", handler.RoleNodeAdd)
	r.GET("/userRoleList", handler.UserRoleList)
	r.GET("/roleNodeList", handler.RoleNodeList)
	
	r.GET("/userList", handler.UserList)
	r.GET("detail", handler.Detail)
	return r
}
